package com.dnjn.happiness.survey.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dnjn.happiness.common.core.model.ModelHappinessScores;
import com.dnjn.happiness.survey.domain.Survey;
import com.dnjn.happiness.survey.domain.SurveyRecord;
import com.dnjn.happiness.survey.domain.vo.AnswerVO;
import com.dnjn.happiness.survey.domain.vo.ExportSurveyRecord;
import com.dnjn.happiness.survey.domain.vo.SurveyAnswerTypeVo;
import com.dnjn.happiness.survey.domain.vo.SurveyRecordVO;
import com.dnjn.happiness.survey.domain.vo.SurveyUserVO;
import com.dnjn.happiness.system.api.domain.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 参加问卷的人记录Mapper接口
 *
 * @author happiness
 * @date 2023-10-23
 */
public interface SurveyRecordMapper extends BaseMapper<SurveyRecord> {
    //查看答题列表
    Page<SurveyRecord> selectRecordList(@Param("dto") Survey domain, Page page);

    Page<SurveyRecord> selectRecordList1(@Param("surveyId") Long surveyId, Page page);

    void updateByUserId(@Param("userId") Long userId, @Param("surveyId") Long surveyId, @Param("surveyScore") Integer surveyScore, @Param("grade") Integer grade, @Param("answerType") String answerType);

    List<ModelHappinessScores> getSurveyRecordHappinessScores(Long userId);

    int getSurveyRecordNotJoin(@Param("userId") Long userId, @Param("time") String time);

    Page<SurveyRecord> getPage(Page page, @Param("dto") SurveyRecordVO surveyRecordVO);

    List<SysUser> goToTheDetailsView(Long surveyId);

    List<SurveyRecord> forSurveyDetailsSeeFeedbackBySurveyIdAndLeaderId(@Param("surveyId") Long surveyId, @Param("leaderId") Long leaderId);

    List<SurveyRecordVO> getPage1(@Param("dto") SurveyRecordVO surveyRecordVO);

    List<SurveyUserVO> selectGrade(Long surveyId);

    SurveyUserVO queryRecord(Long surveyRecordId);


    Page<SurveyRecord> goToTheSurveyDetailsView(Page<SurveyRecord> page, @Param("surveyId") Long surveyId, @Param("SurveyStatus") String SurveyStatus);

    Page<SurveyRecord> answerDetailsFilterTheCorrespondingScoreRange(Page<SurveyRecord> page, @Param("surveyId") Long surveyId, @Param("startScore") Integer startScore, @Param("endScore") Integer endScore);

    List<SurveyRecord> queryRecordX(Long surveyId);

    List<SurveyRecord> selectGradeX(Long surveyId);


    List<SurveyUserVO> serchRecoed(@Param("dto") AnswerVO answerVO);

    Double selectGradeByXY(@Param("userId") Long userId, @Param("time") String time, @Param("recordScore") double recordScore, @Param("x") double x, @Param("y") double y);

    Integer getSurveyRecordNotJoinNew(Long userId);

    List<SurveyRecord> exportSurveyId(Long surveyId);

    List<ExportSurveyRecord> exportSurveyRecord(Long surveyId);

    List<SurveyAnswerTypeVo> getRecordByUserId(@Param("userId") Long userId, @Param("tikuTagsType") String tikuTagsType);

    List<SurveyRecord> queryRecordBySurveyIdIsNot(long surveyId);

}
